{% extends 'xadmin/base/base.html' %}

{% load static %}

{% block title %}
    热门文章管理页面
{% endblock %}

{% block link %}

{% endblock %}

{% block header %}
    热门文章管理
{% endblock %}

{% block header-option %}
    正确的决策来自众人的智慧
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-12 col-xs-12 col-sm-12">
            <div class="box box-primary">
                <div class="box-header">
                    <button class="btn btn-primary pull-right" id="btn-add-news">添加热门文章</button>
                </div>
                <div class="box-body">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>文章名称</th>
                            <th>文章分类</th>
                            <th>优先级</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for one_hot_news in hotNews %}
                            <tr data-id="{{ one_hot_news.id }}" data-priority="{{ one_hot_news.priority }}" data-title="{{ one_hot_news.news.title }}">
                                <td>{{ one_hot_news.news.title }}</td>
                                <td>{{ one_hot_news.news.tag.name }}</td>
                                <td>{{ one_hot_news.get_priority_display }}</td>
                                <td>
                                    <button class="btn btn-xs btn-warning btn-edit">编辑</button>
                                    <button class="btn btn-xs btn-danger btn-del">删除</button>
                                </td>
                            </tr>
                        {% endfor %}


                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script src="../../../static/xadmin/js/news/hot-news.js"></script>
{% endblock %}